Skip to main content

DescribeAlertingMetricRuleResources

Description

call the DescribeAlertingMetricRuleResources interface to query the resources that are being alerted under an alarm rule.

Request Method

POST

Request Path

/apsara/route/cms/DescribeAlertingMetricRuleResources

Request Parameters Common Parameters

NameLocationTypeRequiredSample valueDescription
PageSizeBODYintegerNo10paging size, the default is 10.
regionIdBODYstringYesNo sample value for this parameter.region id
RuleIdBODYstringNoalerRuleId****ID of alarm rule. description GroupId field and RuleId at least one needs to be filled in. When both are filled in, the query must meet both query conditions.
PageBODYintegerNo1paging page number, the default is 1.
versionBODYstringNo2016-01-01version of api
GroupIdBODYstringNo123456application group ID.

Return data

NameTypeSample valueDescription
RequestIdstring9B868619-77B4-4623-AD64-6181EA7CF8FArequest ID.
Messagestringsuccesserror message.
RuleIdstringalerRuleId****alarm rule ID.
ResourcestringuserId=177541323192****,taskId=3****,instanceId=i-bp1a0v6yzqrms01k****resources that require alarms.
StartTimestring1545901080000the time when the resource is associated with the alarm rule. The format is Unix timestamp, which is the number of seconds passed from January 1, 1970.
MetricValuesstring{"Value":631,"timestamp":1554723720000}monitoring value when an alarm is triggered. The format is a JSON string.
LastModifyTimestring1554723762000the time of the last modification. The format is Unix timestamp, which is the number of seconds passed from January 1, 1970.
Codeinteger200status code. description status code 200 indicates success.
Successbooleantruewhether the request was successful.
GroupIdstring123456ID of the application group. description if the alarm rule is associated with an application group, the ID of the application group is displayed here.
LastAlertTimestring1554718182000the time when the alarm was last triggered. The format is Unix timestamp, which is the number of seconds passed from January 1, 1970.
Totalinteger1total number of records.
Enablestringtrueenable status of alarm rules.
ResourcesarrayNoneresource list for alarm rules.
RetryTimesstring3Number of retries.
RuleNamestringcpuAlertalarm rule name.
Thresholdstring400alarm threshold.

Example

Successful Response example

{
"RequestId":"9B868619-77B4-4623-AD64-6181EA7CF8FA",
"Message":"success",
"RuleId":"alerRuleId****",
"Resource":"userId=177541323192****,
taskId=3****,
instanceId=i-bp1a0v6yzqrms01k****",
"StartTime":"1545901080000",
"MetricValues":
{
"Value":631,
"timestamp":1554723720000
},
"LastModifyTime":"1554723762000",
"Code":"200",
"Success":"true",
"GroupId":"123456",
"LastAlertTime":"1554718182000",
"Total":"1",
"Enable":"true",
"Resources":"None",
"RetryTimes":"3",
"RuleName":"cpuAlert",
"Threshold":"400"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}